// 定义对象类型时，属性之间用分号分割
let person: { name: string; age: number; sayHi(): void } = {
    name: "双双",
    age: 26,
    sayHi() {
        console.log("Hi");
    }
}

console.log(person);

// 定义对象类型时，一行只有一个属性时可以去掉分号
let person2: {
    name: string
    age: number
    sayHi(): void
} = {
    name: "双双",
    age: 26,
    sayHi() {
        console.log("Hi");
    }
}
console.log(person2);


// 定义对象类型时，函数的属性也可以用箭头函数指定
let person3: { name: string; age: number; sayHi: () => void } = {
    name: "双双",
    age: 26,
    sayHi() {
        console.log("Hi");
    }
}
console.log(person3);